import {
  Album,
  Artist,
  MusicInfo,
  SongListInfo,
  UserInfo,
} from "./music-info.model";
import { VideoInfo } from "./other.model";

/**
 *   搜索，综合
 */
export interface BaseSearchResult {
  /**
   *   是否还有更多
   */
  more?: boolean;
  /**
   *   查看全部xxx个xx
   */
  moreText?: string;
  resourceIds?: string[];
}

/**
 *   搜索出来的专辑信息的result结构
 */
export interface AlbumSearchResult extends BaseSearchResult {
  albums: Album[];
}

/**
 *   搜索出来的歌手信息的result结构
 */
export interface ArtistSearchResult extends BaseSearchResult {
  artists: Artist[];
}

/**
 *   搜索出来的电台信息的result结构
 */
export interface DJRadioSearchResult extends BaseSearchResult {
  /**
   *   暂时没用上，就没写数据类型
   */
  djRadios?: any[];
}

export interface MLogSearchResult extends BaseSearchResult {
  mlogs?: any[];
}

/**
 *   搜索出来的歌单信息的result结构
 */
export interface PlayListSearchResult extends BaseSearchResult {
  playLists?: SongListInfo[];
}

export interface SimilarQuery {
  /**
   *   unknown
   */
  alg?: string;
  keyword?: string;
}

/**
 *   搜索出来的歌曲信息的result结构
 */
export interface SongSearchResult extends BaseSearchResult {
  ksongInfos?: any;
  songs?: MusicInfo[];
}

/**
 *   搜索出来的用户信息的result结构
 */
export interface UserSearchResult extends BaseSearchResult {
  users?: UserInfo[];
}

/**
 *   搜索出来的歌曲信息的result结构
 */
export interface SongSearchResult extends BaseSearchResult {
  ksongInfos?: any;
  songs?: MusicInfo[];
}

export interface VideoSearchResult extends BaseSearchResult {
  videos?: VideoInfo[];
}

/**
 *   搜索综合信息
 */
export interface SearchAllResponse {
  code?: number;
  result: {
    code?: number;
    album?: AlbumSearchResult;
    artist?: ArtistSearchResult;
    djRadio?: DJRadioSearchResult;
    mlog?: MLogSearchResult;
    order?: string[];
    playList?: PlayListSearchResult;
    rec_query?: any;
    rec_type?: any;
    sim_query?: {
      code?: number;
      sim_querys?: SimilarQuery[];
    };
    song: SongSearchResult;
    talk: BaseSearchResult & { talks: any[] };
    user: UserInfo;
    video: VideoSearchResult;
  };
}
